Inverse, Natural Log, and Exponential Functions

Introduction

In this notebook, we will explore two functions that have very important Calculus properties: the natural log function ln(x) and the exponential function (e^x). As we shall see, they are related to each other as inverse functions. We shall also look more in depth into this inverse function relationship and how it relates to Calculus.

The Exponential Function

Mathematica distinguishes the special number e from the letter e. There are a number of ways of obtaining the number e, and they are all equivalent.
The first and easiest way to get e is to remember that all Mathematica functions and constants start with capital letters:

N[E]

You could also use palettes, or the escaped shortcut to obtain e:

N[E]

You can also use the builtin function Exp and evaluate it at 1 to get the constant e:

N[Exp[1]]

From here on in, this worksheet will use Exp. Let's see what the graph of the exponential function looks like:

Plot[Exp[x],{x,-4,4}]

One question that we may ask is, are there any asymptotes? We can check this with limits:

Limit[Exp[x],x-> -Infinity]
Limit[Exp[x],x-> Infinity]

The exponential function has a number of special properties, the most relevant of which is that it is the only function which is its own derivative:

Exp[x]
D[Exp[x],x]
Exp[x]==D[Exp[x],x]

The exponential function also relates addition and multiplication of the exponent to multiplication and exponentiation of the function itself:

Exp[x*y]==Exp[x]^y
Exp[x+y]==Exp[x]*Exp[y]

There are a number of special commands for algebraic reduction that Mathematica does not perform by default. The one that figures out the relationships with the Exponential function is called PowerExpand:

Exp[x*y]==PowerExpand[Exp[x]^y]

If you forget which special command to use, you can also show they are equal with plots:

Plot3D[Exp[x*y]-Exp[x]^y,{x,-10,10},{y,-10,10}]

The Natural Logarithm Function

The Natural Logarithm function is much more straightforward than the exponential function. There is only the single command Log. Using Log with only one argument gives the natural log:

N[Log[Exp[1]]]

While using Log with two arguments allows you to specify the base. Note that the base comes first when you use two arguments.

N[Log[2,Exp[1]]]
N[Log[Exp[1],2]]

Let' s see what the graph of the Natural Logarithm looks like :

Plot[Log[x],{x,-4,4}]

Once aagain we can ask if there are any asymptotes :

Limit[Log[x],x-> 0]
Limit[Log[x],x-> Infinity]

The Natural Log's special property is that its derivative is the reciprocal function f(x)=(1/x).

D[Log[x],x]

It also relates addition, multiplication, and exponentiation just like the exponential function. Just like before, Mathematica's default solver doesn't check for this and you have to use PowerExpand :

Log[x]+Log[y]==PowerExpand[Log[x*y]]
y*Log[x]==PowerExpand[Log[x^y]]

Inverse Functions

Let us return to an example from the Natural Log section:

N[Log[Exp[1]]]

The number "1" was fed into the exponential function to obtain the number "e." This was then fed into the natural log function and "1" came back out. This is true for every number in the exponential function's domain. The reverse is also true (but only for the numbers in the natural log function's domain). Be aware that Mathematica does not do this domain checking.

N[Log[Exp[5]]]
N[Log[Exp[-3]]]
N[Exp[Log[-3]]]
N[Exp[Log[1]]]
N[Exp[Log[5]]]

We can illustrate this result with a plot:

Plot[{Log[x],x,Exp[x]},{x,-4,4},PlotRange-> {{-4,4},{-4,4}}, AspectRatio-> 1]

From the plot, the two functions are reflections of each other about the line y=x. This is called the inverse relationship. Many other (but not all) functions have inverses. We can find inverses the same way that it is done by hand, solving algebraically:

Clear[y]
f[x_]:=3*Log[Sqrt[x+4]]
yofx=Solve[y==f[x],x][[1]]
finverse[y_]=x/.yofx
Plot[{f[x],x,finverse[x]},{x,-6,6}, AspectRatio-> 1]

There is an InverseFunction command, but it only works on builtin functions like Sin:

f[x_]:=3*Log[Sqrt[x+4]]
InverseFunction[f]
InverseFunction[Sin]

We can tell whether a function is invertible from its plot. It must pass the horizontal line test. Consider the following two plots:

Plot[x^2,{x,-4,4}]
Plot[2*x,{x,-4,4}]

The second function is invertible, but the first one is not. If a function is not invertible, we can make it invertible by restricting the domain. Consider the first function again, but under the assumption of x always being nonnegative:

Plot[{x^2,Sqrt[x],x},{x,0,4},PlotRange-> {{0,4},{0,4}}, AspectRatio-> 1]

Knowledge of a function's inverse can give us information about the Calculus properties of the function. This is accomplished by the formula (d/(d x))(f^(-1))(x)=(1/(f'((f^(-1))(x)))). Let's show what is going on with this formula with a plot:

Plot[{x^2,Sqrt[x],x,Sqrt[1.5],x/(2Sqrt[1.5])+Sqrt[1.5]-Sqrt[1.5]/2,x*2Sqrt[1.5]-1.5},{x,0,2},PlotRange-> {{0,2},{0,2}}, AspectRatio-> 1, PlotStyle -> {{Red},{Blue},{Brown, Dashed},{Darker[Green], Dotted},{Cyan},{Gray}}]

The function (Sqrt[x]) (the blue line of the plot above) at x=1.5 is (Sqrt[1.5]) (the dotted green line). If we go to the spot where the inverse of (Sqrt[x]), (x^2) (the red line), is equal to (Sqrt[1.5]), then the function representing the tangent line to (x^2) at this point (the gray line) is the inverse of the function representing the tangent line to (Sqrt[x]) at x=1.5 (the cyan line). Because these two tangent lines are inverses, their slopes are reciprocals. This means that the derivatives at the points where (Sqrt[x]) and (x^2) are both equal to (Sqrt[1.5]) are reciprocals.

If we use other inverse pairs, or other points, the formula says that we'll get the same relationship. The following command will allow us to vary the points to check for the pairs (x^2) and(Sqrt[x]):

Manipulate[Plot[{x^2,Sqrt[x],x,Sqrt[t],x/(2Sqrt[t])+Sqrt[t]-Sqrt[t]/2,x*2Sqrt[t]-t},{x,0,2},PlotRange-> {{0,2},{0,2}}, AspectRatio-> 1, PlotStyle -> {{Red},{Blue},{Brown, Dashed},{Darker[Green], Dotted},{Cyan},{Gray}}],{t,0.0001,2}]

Exercises

Assignment 1: Limiting Behavior of Exponentials and Logs

Use Mathematica to plot the functions f(x)=(e^(1/(4(4-5x+(x^2)))))and g(x)=ln((((x^2)-1)/(x+3))), and explore their limiting behavior. Your answer should include:

Plots of both functions, clearly showing two discontinuities in f and the entire internal region of discontinuity in g.

Evaluation of the left and right-hand limits for every point where evaluation of the limit from that direction makes sense.

Evaluation of the overall limit for every discontinuty, including checking limits at both ∞ and -∞.

Useful commands for this exercise:

Plot[functionname[variable],{variable,leftborder,rightborder},PlotRange->{lowborder,highborder}, PlotLabel->Title] plots a function and explicitly gives the range of coordinates over which to plot. It also allows you to specify a title.

Limit[functionname[variable],variable->limit] evaluates the overall limit.

Limit[functionname[variable],variable->limit,Direction->direction] evaluates the limit from a specific direction: left (Direction->1) or right (Direction->-1).

Assignment 2: A Property of Logs

Integrate f(x)=(1/x) over the regions [2,14], [20,140], [200,1400], and [2000,14000]. Explain what is happening and identify the property(ies) of logs that is at work here. Your answer should include:

The values of the definite integral over the four given regions.

An explanation of what is going on with the answers (are there any patterns?, etc)

An explicit identification of the property(ies) of logs that caused the answers to be what they are.

A statement of why the identified property(ies) cause the answers to be what they are.

Useful commands for this exercise:

Integrate[functioname[variable],{variable, leftlimit, rightlimit}] computes the definite integral of a function over a given region.

Assignment 3:  Computing the Intersection with an Exponential Function

Sometimes the x-values of intersection of an exponential function with another function are not immediately easy to understand. Plot the functions f(x)=(2^x) and g(x)=(x^2) and solve for their points of intersection. Your answer should include:

Plots of both functions on the same graph, with the three points of intersection clearly visible.

A symbolic solution for all three points of intersection.

A numeric solution for all three points of intersection.

Useful commands for this exercise:

Plot[{function1name[variable],function2name[variable]},{variable,leftborder,rightborder},PlotRange->{lowborder,highborder}, PlotLabel->Title] plots two functions and explicitly gives the range of coordinates over which to plot. It also allows you to specify a title.

Solve[{expression1==expression2},{variable}] solves symbolically for the situation where expression1 is equal to expression2.

NSolve[{expression1==expression2},{variable}] solves numerically for the situation where expression1 is equal to expression2.

Assignment 4:  The Square Exponential Function

Explore the square exponential function f(x)=(e^((x^2)/a)). Your answer should include:

Plots of the given function for several different values of a. Multiple curves on the same plot and/or use of Manipulate is optional but recommended.

Estimates of the maximum value(s), inflection point(s), and any asymptote(s), given in terms of a.

Useful commands for this exercise:

Plot[functionname[variable],{variable,leftborder,rightborder},PlotRange->{lowborder,highborder}, PlotLabel->Title] plots a function and explicitly gives the range of coordinates over which to plot. It also allows you to specify a title.

Assignment 5:  Determining an Inverse

Compute the inverse of the function f(x)=((2x+7)/(3x-17)). Your answer should include:

The region of the domain over which the given function is invertible.

A symbolic solution of the inverse of the function.

A plot of the function, its inverse, and the function y=x on the same plot.

Useful commands for this exercise:

Plot[functionname[variable],{variable,leftborder,rightborder},PlotRange->{lowborder,highborder}, PlotLabel->Title] plots a function and explicitly gives the range of coordinates over which to plot. It also allows you to specify a title.

Solve[{expression1==expression2},{variable}] solves symbolically for the situation where expression1 is equal to expression2.

Plot[{function1name[variable],function2name[variable],function3name[variable]},{variable,leftborder,rightborder},PlotRange->{lowborder,highborder}, PlotLabel->Title] plots three functions and explicitly gives the range of coordinates over which to plot. It also allows you to specify a title.